3.135 \(\int \tanh ^3(c+d x) (a+b \tanh ^2(c+d x)) \, dx\)

Optimal. Leaf size=49 \[ -\frac{(a+b) \tanh ^2(c+d x)}{2 d}+\frac{(a+b) \log (\cosh (c+d x))}{d}-\frac{b \tanh ^4(c+d x)}{4 d} \]

[Out]

((a + b)*Log[Cosh[c + d*x]])/d - ((a + b)*Tanh[c + d*x]^2)/(2*d) - (b*Tanh[c + d*x]^4)/(4*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0594662, antiderivative size = 49, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3631, 3473, 3475} \[ -\frac{(a+b) \tanh ^2(c+d x)}{2 d}+\frac{(a+b) \log (\cosh (c+d x))}{d}-\frac{b \tanh ^4(c+d x)}{4 d} \]

Antiderivative was successfully verified.

[In]

Int[Tanh[c + d*x]^3*(a + b*Tanh[c + d*x]^2),x]

[Out]

((a + b)*Log[Cosh[c + d*x]])/d - ((a + b)*Tanh[c + d*x]^2)/(2*d) - (b*Tanh[c + d*x]^4)/(4*d)

Rule 3631

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp
[(C*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Dist[A - C, Int[(a + b*Tan[e + f*x])^m, x], x] /; FreeQ[
{a, b, e, f, A, C, m}, x] && NeQ[A*b^2 + a^2*C, 0] &&  !LeQ[m, -1]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \tanh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx &=-\frac{b \tanh ^4(c+d x)}{4 d}+(a+b) \int \tanh ^3(c+d x) \, dx\\ &=-\frac{(a+b) \tanh ^2(c+d x)}{2 d}-\frac{b \tanh ^4(c+d x)}{4 d}+(a+b) \int \tanh (c+d x) \, dx\\ &=\frac{(a+b) \log (\cosh (c+d x))}{d}-\frac{(a+b) \tanh ^2(c+d x)}{2 d}-\frac{b \tanh ^4(c+d x)}{4 d}\\ \end{align*}

Mathematica [A]  time = 0.235594, size = 43, normalized size = 0.88 \[ -\frac{2 (a+b) \tanh ^2(c+d x)-4 (a+b) \log (\cosh (c+d x))+b \tanh ^4(c+d x)}{4 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Tanh[c + d*x]^3*(a + b*Tanh[c + d*x]^2),x]

[Out]

-(-4*(a + b)*Log[Cosh[c + d*x]] + 2*(a + b)*Tanh[c + d*x]^2 + b*Tanh[c + d*x]^4)/(4*d)

________________________________________________________________________________________

Maple [B]  time = 0.004, size = 104, normalized size = 2.1 \begin{align*} -{\frac{b \left ( \tanh \left ( dx+c \right ) \right ) ^{4}}{4\,d}}-{\frac{a \left ( \tanh \left ( dx+c \right ) \right ) ^{2}}{2\,d}}-{\frac{b \left ( \tanh \left ( dx+c \right ) \right ) ^{2}}{2\,d}}-{\frac{\ln \left ( \tanh \left ( dx+c \right ) -1 \right ) a}{2\,d}}-{\frac{\ln \left ( \tanh \left ( dx+c \right ) -1 \right ) b}{2\,d}}-{\frac{\ln \left ( \tanh \left ( dx+c \right ) +1 \right ) a}{2\,d}}-{\frac{\ln \left ( \tanh \left ( dx+c \right ) +1 \right ) b}{2\,d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(d*x+c)^3*(a+b*tanh(d*x+c)^2),x)

[Out]

-1/4*b*tanh(d*x+c)^4/d-1/2/d*a*tanh(d*x+c)^2-1/2*b*tanh(d*x+c)^2/d-1/2/d*ln(tanh(d*x+c)-1)*a-1/2/d*ln(tanh(d*x
+c)-1)*b-1/2/d*ln(tanh(d*x+c)+1)*a-1/2/d*ln(tanh(d*x+c)+1)*b

________________________________________________________________________________________

Maxima [B]  time = 1.66453, size = 227, normalized size = 4.63 \begin{align*} b{\left (x + \frac{c}{d} + \frac{\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac{4 \,{\left (e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )}\right )}}{d{\left (4 \, e^{\left (-2 \, d x - 2 \, c\right )} + 6 \, e^{\left (-4 \, d x - 4 \, c\right )} + 4 \, e^{\left (-6 \, d x - 6 \, c\right )} + e^{\left (-8 \, d x - 8 \, c\right )} + 1\right )}}\right )} + a{\left (x + \frac{c}{d} + \frac{\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac{2 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d{\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + 1\right )}}\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)^3*(a+b*tanh(d*x+c)^2),x, algorithm="maxima")

[Out]

b*(x + c/d + log(e^(-2*d*x - 2*c) + 1)/d + 4*(e^(-2*d*x - 2*c) + e^(-4*d*x - 4*c) + e^(-6*d*x - 6*c))/(d*(4*e^
(-2*d*x - 2*c) + 6*e^(-4*d*x - 4*c) + 4*e^(-6*d*x - 6*c) + e^(-8*d*x - 8*c) + 1))) + a*(x + c/d + log(e^(-2*d*
x - 2*c) + 1)/d + 2*e^(-2*d*x - 2*c)/(d*(2*e^(-2*d*x - 2*c) + e^(-4*d*x - 4*c) + 1)))

________________________________________________________________________________________

Fricas [B]  time = 2.1544, size = 3336, normalized size = 68.08 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)^3*(a+b*tanh(d*x+c)^2),x, algorithm="fricas")

[Out]

-((a + b)*d*x*cosh(d*x + c)^8 + 8*(a + b)*d*x*cosh(d*x + c)*sinh(d*x + c)^7 + (a + b)*d*x*sinh(d*x + c)^8 + 2*
(2*(a + b)*d*x - a - 2*b)*cosh(d*x + c)^6 + 2*(14*(a + b)*d*x*cosh(d*x + c)^2 + 2*(a + b)*d*x - a - 2*b)*sinh(
d*x + c)^6 + 4*(14*(a + b)*d*x*cosh(d*x + c)^3 + 3*(2*(a + b)*d*x - a - 2*b)*cosh(d*x + c))*sinh(d*x + c)^5 +
2*(3*(a + b)*d*x - 2*a - 2*b)*cosh(d*x + c)^4 + 2*(35*(a + b)*d*x*cosh(d*x + c)^4 + 3*(a + b)*d*x + 15*(2*(a +
 b)*d*x - a - 2*b)*cosh(d*x + c)^2 - 2*a - 2*b)*sinh(d*x + c)^4 + 8*(7*(a + b)*d*x*cosh(d*x + c)^5 + 5*(2*(a +
 b)*d*x - a - 2*b)*cosh(d*x + c)^3 + (3*(a + b)*d*x - 2*a - 2*b)*cosh(d*x + c))*sinh(d*x + c)^3 + (a + b)*d*x
+ 2*(2*(a + b)*d*x - a - 2*b)*cosh(d*x + c)^2 + 2*(14*(a + b)*d*x*cosh(d*x + c)^6 + 15*(2*(a + b)*d*x - a - 2*
b)*cosh(d*x + c)^4 + 2*(a + b)*d*x + 6*(3*(a + b)*d*x - 2*a - 2*b)*cosh(d*x + c)^2 - a - 2*b)*sinh(d*x + c)^2
- ((a + b)*cosh(d*x + c)^8 + 8*(a + b)*cosh(d*x + c)*sinh(d*x + c)^7 + (a + b)*sinh(d*x + c)^8 + 4*(a + b)*cos
h(d*x + c)^6 + 4*(7*(a + b)*cosh(d*x + c)^2 + a + b)*sinh(d*x + c)^6 + 8*(7*(a + b)*cosh(d*x + c)^3 + 3*(a + b
)*cosh(d*x + c))*sinh(d*x + c)^5 + 6*(a + b)*cosh(d*x + c)^4 + 2*(35*(a + b)*cosh(d*x + c)^4 + 30*(a + b)*cosh
(d*x + c)^2 + 3*a + 3*b)*sinh(d*x + c)^4 + 8*(7*(a + b)*cosh(d*x + c)^5 + 10*(a + b)*cosh(d*x + c)^3 + 3*(a +
b)*cosh(d*x + c))*sinh(d*x + c)^3 + 4*(a + b)*cosh(d*x + c)^2 + 4*(7*(a + b)*cosh(d*x + c)^6 + 15*(a + b)*cosh
(d*x + c)^4 + 9*(a + b)*cosh(d*x + c)^2 + a + b)*sinh(d*x + c)^2 + 8*((a + b)*cosh(d*x + c)^7 + 3*(a + b)*cosh
(d*x + c)^5 + 3*(a + b)*cosh(d*x + c)^3 + (a + b)*cosh(d*x + c))*sinh(d*x + c) + a + b)*log(2*cosh(d*x + c)/(c
osh(d*x + c) - sinh(d*x + c))) + 4*(2*(a + b)*d*x*cosh(d*x + c)^7 + 3*(2*(a + b)*d*x - a - 2*b)*cosh(d*x + c)^
5 + 2*(3*(a + b)*d*x - 2*a - 2*b)*cosh(d*x + c)^3 + (2*(a + b)*d*x - a - 2*b)*cosh(d*x + c))*sinh(d*x + c))/(d
*cosh(d*x + c)^8 + 8*d*cosh(d*x + c)*sinh(d*x + c)^7 + d*sinh(d*x + c)^8 + 4*d*cosh(d*x + c)^6 + 4*(7*d*cosh(d
*x + c)^2 + d)*sinh(d*x + c)^6 + 8*(7*d*cosh(d*x + c)^3 + 3*d*cosh(d*x + c))*sinh(d*x + c)^5 + 6*d*cosh(d*x +
c)^4 + 2*(35*d*cosh(d*x + c)^4 + 30*d*cosh(d*x + c)^2 + 3*d)*sinh(d*x + c)^4 + 8*(7*d*cosh(d*x + c)^5 + 10*d*c
osh(d*x + c)^3 + 3*d*cosh(d*x + c))*sinh(d*x + c)^3 + 4*d*cosh(d*x + c)^2 + 4*(7*d*cosh(d*x + c)^6 + 15*d*cosh
(d*x + c)^4 + 9*d*cosh(d*x + c)^2 + d)*sinh(d*x + c)^2 + 8*(d*cosh(d*x + c)^7 + 3*d*cosh(d*x + c)^5 + 3*d*cosh
(d*x + c)^3 + d*cosh(d*x + c))*sinh(d*x + c) + d)

________________________________________________________________________________________

Sympy [A]  time = 0.639558, size = 88, normalized size = 1.8 \begin{align*} \begin{cases} a x - \frac{a \log{\left (\tanh{\left (c + d x \right )} + 1 \right )}}{d} - \frac{a \tanh ^{2}{\left (c + d x \right )}}{2 d} + b x - \frac{b \log{\left (\tanh{\left (c + d x \right )} + 1 \right )}}{d} - \frac{b \tanh ^{4}{\left (c + d x \right )}}{4 d} - \frac{b \tanh ^{2}{\left (c + d x \right )}}{2 d} & \text{for}\: d \neq 0 \\x \left (a + b \tanh ^{2}{\left (c \right )}\right ) \tanh ^{3}{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)**3*(a+b*tanh(d*x+c)**2),x)

[Out]

Piecewise((a*x - a*log(tanh(c + d*x) + 1)/d - a*tanh(c + d*x)**2/(2*d) + b*x - b*log(tanh(c + d*x) + 1)/d - b*
tanh(c + d*x)**4/(4*d) - b*tanh(c + d*x)**2/(2*d), Ne(d, 0)), (x*(a + b*tanh(c)**2)*tanh(c)**3, True))

________________________________________________________________________________________

Giac [B]  time = 1.21444, size = 130, normalized size = 2.65 \begin{align*} -\frac{{\left (d x + c\right )}{\left (a + b\right )}}{d} + \frac{{\left (a + b\right )} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}{d} + \frac{2 \,{\left ({\left (a + 2 \, b\right )} e^{\left (6 \, d x + 6 \, c\right )} + 2 \,{\left (a + b\right )} e^{\left (4 \, d x + 4 \, c\right )} +{\left (a + 2 \, b\right )} e^{\left (2 \, d x + 2 \, c\right )}\right )}}{d{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)^3*(a+b*tanh(d*x+c)^2),x, algorithm="giac")

[Out]

-(d*x + c)*(a + b)/d + (a + b)*log(e^(2*d*x + 2*c) + 1)/d + 2*((a + 2*b)*e^(6*d*x + 6*c) + 2*(a + b)*e^(4*d*x
+ 4*c) + (a + 2*b)*e^(2*d*x + 2*c))/(d*(e^(2*d*x + 2*c) + 1)^4)